/*
 * Copyright 2008. Mount Sinai Hospital, Toronto, Canada.
 * 
 * Licensed under the Apache License, Version 2.0. You
 * can find a copy of the license at:
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * IN NO EVENT SHALL MOUNT SINAI HOSPITAL BE LIABLE TO ANY PARTY FOR DIRECT, 
 * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST 
 * PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, 
 * EVEN IF MOUNT SINAI HOSPITAL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 
 * DAMAGE.
 * 
 * MOUNT SINAI HOSPITAL SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTIES OF 
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE AND 
 * ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS". 
 * MOUNT SINAI HOSPITAL HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, 
 * UPDATES, ENHANCEMENTS, OR MODIFICATIONS. 
 */

package com.sinai.mshab.format.util;

/**
 * This interface contains almost all the methods that the {@code
 * java.util.Observable} class has, except it is an interface. There are a
 * number of times when a class has to extend some other class and is thus
 * unable to be {@code Observable}. Furthermore, it is not possible to make
 * interfaces {@code Observable} and thus insure all the concrete classes are
 * also {@code Observable}. Therefore, this interface had to be created.
 * 
 * @author Arthur Kalmenson
 * @author Sergey Vesselov
 */
public interface Observable {

	/**
	 * Adds a new {@link Observer} to observe this object.
	 * 
	 * @param observer
	 *            the new observer
	 */
	public void addObserver(Observer observer);

	/**
	 * Returns the number of {@link Observer}s this object has.
	 * 
	 * @return the number of {@code Observer}s this object has.
	 */
	public int countObservers();

	/**
	 * Removes the {@link Observer}, {@code observer}, from the list of
	 * observing objects.
	 * 
	 * @param observer
	 *            the {@code Observer} to remove.
	 */
	public void deleteObserver(Observer observer);

	/**
	 * Deletes all the {@link Observer}s this object has.
	 */
	public void deleteObservers();

	/**
	 * Notifies all {@link Observer}s that this object has now changed.
	 */
	public void notifyObservers();

}
